home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / KeyDownBrowser / KeyDownMatrix.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  47 lines

  1. //---------------------------------------------------------------------------------------------------------
  2. //
  3. //    KeyDownMatrix
  4. //
  5. //    Inherits From:        Matrix
  6. //
  7. //    Declared In:        KeyDownMatrix.h
  8. //
  9. //    Disclaimer
  10. //
  11. //        You may freely copy, distribute and reuse this software and its
  12. //        associated documentation. I disclaim any warranty of any kind, 
  13. //        expressed or implied, as to its fitness for any particular use.
  14. //
  15. //---------------------------------------------------------------------------------------------------------
  16. #import "KeyDownMatrix.h"
  17.  
  18.  
  19. @implementation KeyDownMatrix
  20.  
  21. - mouseDown: (NXEvent*) theEvent
  22. {
  23.     //  Override to make KeyDownBrowser first responder (ascend view hierarchy -
  24.     //  Matrix, ClipView, ScrollView, KeyDownBrowser).  Making any of the subviews
  25.     //  first responder would work, as the responder chain would eventually hit browser.
  26.     //  Specifying the browser eliminates the unnecessary search.
  27.     
  28.     if ([self isEnabled] == NO) return self;
  29.     [super mouseDown: theEvent];
  30.     [[self window] makeFirstResponder: [[superview superview] superview]];
  31.     return self;
  32. }
  33.  
  34.  
  35. - (int) numRows
  36. {
  37.     return numRows;
  38. }
  39.  
  40.  
  41. - (int) numCols
  42. {
  43.     return numCols;
  44. }
  45.  
  46.  
  47. @end